﻿package core.ui.dialogs
{
    import core.enum.*;
    import core.event.*;
    import core.image.*;
    import core.ui.controls.*;

    public class TiltShiftDialog extends BitmapOperationDialogBase
    {
        var f:Filter;
        var b:Slidebar;
        var m:Slidebar;
        var cb:Checkbox;

        public function TiltShiftDialog(param1:Tuyitu)
        {
            super(param1, "rm_tilt_shift", 240, 190, Action.TiltShiftFilter);
            this.f = new Filter();
            this.b = new Slidebar("rm_focus_size", 1, 100, 200, 35);
            this.b.addEventListener(SliderEvent.CHANGE, this.Change, false, 1, true);
            this.b.x = 20;
            this.b.y = 35;
            addChild(this.b);
            this.m = new Slidebar("rm_focus_location", 1, 100, 200, 80);
            this.m.addEventListener(SliderEvent.CHANGE, this.Change, false, 1, true);
            this.m.x = 20;
            this.m.y = 80;
            addChild(this.m);
            this.cb = new Checkbox("rm_saturate");
            this.cb.addEventListener(SliderEvent.CHANGE, this.Change, false, 1, true);
            this.cb.x = 20;
            this.cb.y = 125;
            addChild(this.cb);
            return;
        }// end function

        override public function Change(... args) : void
        {
            if (!locked)
            {
                bm.copyPixels(bc, bm.rect, bm.rect.topLeft);
                this.f.TiltShift(bm, bc, this.b.value, this.m.value, this.cb.checked);
            }
            return;
        }// end function

    }
}
